"use strict";
function max(arr) {
    let num = 0;
    let count = 0;
    let sun = 0;
    arr.forEach((item, index) => {
        if ((index + 1) % 2 == 0) {
            count = item;
        }
        else if ((index + 1) % 2 != 0 && index != 0) {
            sun = item - count;
            num += sun;
        }
    });
    return num;
}
console.log(max([7, 1, 5, 3, 6, 4]));
console.log(max([7, 4, 5, 3, 6, 4]));
function use(a, b) {
    return a + b;
}
console.log(use(6, 6));
function bl(arr) {
    let arr1 = 0;
    arr.forEach((item, index) => {
        arr1 += item;
    });
    return arr1;
}
console.log(bl(([1, 5, 6, 9, 7])));
